package com.elitesland.demo.controller.backend.entity;


import com.elitesland.core.base.BaseModel;
import com.elitesland.system.annotation.Comment;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 销售单主表
 */
@Entity
@Table(name = "so")
@org.hibernate.annotations.Table(appliesTo = "so", comment = "销售单主表")
@Data
@DynamicInsert
@DynamicUpdate
@Accessors(chain = true)
@ApiModel(value = "SO", description = "销售单主表")
@EqualsAndHashCode(callSuper=true)
public class SoDO extends BaseModel implements Serializable
{


    @ApiModelProperty("SO_CODE")
    @Comment("SO_CODE")
    @Column(length = 40 )
    String soCode;

    @ApiModelProperty("单据状态 1.草稿,2已提交,3审批通过,4审批驳回                                         String")
    @Comment("单据状态 1.草稿,2已提交,3审批通过,4审批驳回                                         String")
    @Column(length = 40 )
    String docStatus;

    @ApiModelProperty("客户编码 售至")
    @Comment("客户编码 售至")
    @Column(length = 40 )
    String custCode;

    @ApiModelProperty("客户名称")
    @Comment("客户名称")
    @Column(length = 40 )
    String custName;

    @ApiModelProperty("税率")
    @Comment("税率")
    @Column()
    Double taxRate;

    @ApiModelProperty("税额")
    @Comment("税额")
    @Column(precision = 20, scale = 2)
    BigDecimal taxAmt;

    @ApiModelProperty("含税总金额")
    @Comment("含税总金额")
    @Column(precision = 20, scale = 2)
    BigDecimal amt;

    @ApiModelProperty("未税总金额")
    @Comment("未税总金额")
    @Column(precision = 20, scale = 2)
    BigDecimal netAmt;

    @ApiModelProperty("基准价格总价")
    @Comment("基准价格总价")
    @Column(precision = 20, scale = 2)
    BigDecimal baseAmt;

    @ApiModelProperty("收货地址号")
    @Comment("收货地址号")
    @Column()
    Integer recvAddrNo;

    @ApiModelProperty("审批状态 [UDC]COM:APPR_STATUS 审批通过,审批驳回")
    @Comment("审批状态 [UDC]COM:APPR_STATUS 审批通过,审批驳回")
    @Column(length = 40 )
    String apprStatus;

    @ApiModelProperty("审批时间")
    @Comment("审批时间")
    @Column()
    LocalDateTime apprTime;

    @ApiModelProperty("审批人ID")
    @Comment("审批人ID")
    @Column()
    Long apprUserId;

    @ApiModelProperty("审批意见")
    @Comment("审批意见")
    @Column(length = 500 )
    String apprComment;



}